
public class Account {
	
	private int accountNumber;
	private int pin;
	private double availableBalance;
	private double totalBalance;
	
	public Account(int accountNumber, int pin, double availableBalance, double totalBalance) {
		
		this.setAccountNumber(accountNumber);
		this.pin = pin;
		this.setAvailableBalance(availableBalance);
		this.setTotalBalance(totalBalance);
	}
	
	public boolean validatePin(int userPin) {
		if( userPin == this.pin) return true;
		else return false;
	}
	
	public void credit(double amount) {
		this.availableBalance += amount;
		this.totalBalance += amount;
	}
	
	public void debit(double amount) {
		this.availableBalance -= amount;
		this.totalBalance -= amount;
	}

	public double getAvailableBalance() {
		return availableBalance;
	}

	public void setAvailableBalance(double availableBalance) {
		this.availableBalance = availableBalance;
	}

	public double getTotalBalance() {
		return totalBalance;
	}

	public void setTotalBalance(double totalBalance) {
		this.totalBalance = totalBalance;
	}

	
	public int getAccountNumber() {
		return accountNumber;
	}

	
	public void setAccountNumber(int accountNumber) {
		this.accountNumber = accountNumber;
	}

}
